package com.imooc.portal.web;

import com.imooc.business.RuleBusiness;
import com.imooc.module.collect.request.AddRuleRequest;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Tim
 * @Description: 规则接口
 * @Version 1.0
 */
@RestController
@RequestMapping("/data-center/rule")
public class RuleController {
    @Setter(onMethod_ = @Autowired)
    private RuleBusiness ruleBusiness;

    @PostMapping("/add")
    public Boolean addRule(@RequestBody AddRuleRequest request) {
        return ruleBusiness.addRule(request);
    }
}
